import type { ProColumns } from '@ant-design/pro-table';
export type columnsDataType = {
  configDate: Date;
  configName: string;
  configNo: string;
  createdBy: null;
  createdTime: null;
  effDt: Date;
  expDt: Date;
  status: number;
  totalDailyInvestment: number;
  updatedBy: string;
  updatedTime: Date;
};
let columnsData: ProColumns<columnsDataType>[] = [

  // 配置搜索框
  {
    title: '规则名称',
    dataIndex: 'configName',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '规则编号',
    dataIndex: 'configNo',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '规则状态',
    dataIndex: 'status',
    valueType: 'select',
    hideInTable: true,
    valueEnum: {
      0: {
        text: '生效',
        status: 'Success',
      },
      1: {
        text: '失效',
        status: 'Error',
      },
      2: {
        text: '未生效',
        status: 'Default',
      },
    },
  },
  {
    title: '配置日期',
    dataIndex: 'configurationDate',
    valueType: 'dateRange',
    colSize: 1,
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          startConfigDate: value[0],
          endConfigDate: value[1],
        };
      },
    },
  },
  {
    title: '生效日期',
    dataIndex: 'effectiveDate',
    colSize: 1,
    valueType: 'dateRange',
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
          startEffDt: value[0],
          endEffDt: value[1],
        };
      },
    },
  },

  // table里面的内容
  {
    title: '序号',
    dataIndex: 'order',
    width: 50,
    fixed: 'left',
    valueType: 'indexBorder',
  },
  {
    title: '规则名称',
    dataIndex: 'configName',
    hideInSearch: true,
    width: 150,
    fixed: 'left',
  },
  {
    title: '规则编号',
    dataIndex: 'configNo',
    hideInSearch: true,
    width: 150,
    fixed: 'left',
  },
  {
    title: '配置日期',
    dataIndex: 'configDate',
    hideInSearch: true,
    width: 120,
    valueType: 'date'
  },
  {
    title: '生效日期',
    dataIndex: 'effDt',
    colSize: 1.5,
    width: 120,
    hideInSearch: true,
    valueType: 'date'
  },
  {
    title: '失效日期',
    dataIndex: 'expDt',
    hideInSearch: true,
    width: 120,
    valueType: 'date'
  },
  {
    title: '规则状态',
    dataIndex: 'status',
    valueType: 'select',
    hideInSearch: true,
    width: 80,
    valueEnum: {
      0: {
        text: '生效',
        status: 'Success',
      },
      1: {
        text: '失效',
        status: 'Error',
      },
      2: {
        text: '未生效',
        status: 'Default',
      },
    },
  },
  {
    title: '投入和平币数量',
    hideInSearch: true,
    dataIndex: 'totalDailyInvestment',
    valueType: 'digit',
    width: 150,
  },
  {
    title: '操作',
    hideInSearch: true,
    width: 100,
    fixed: 'right',
    dataIndex: 'action',
  },
];

export default columnsData;